import random
import os
import numpy as np
import torch

def set_seed(seed=42):
    """
        seed everything to reproduce your experiments
        :param int seed: default 42
        :return: None
    """
    random.seed(seed)
    os.environ['PYTHONHASHSEED'] = str(seed)
    np.random.seed(seed)
    torch.manual_seed(seed)
    torch.cuda.manual_seed(seed)
    torch.backends.cudnn.deterministic = True

